Common functions need to refer to the static method that System.IO directly can call path 1 class Program 2 {3 static void Main (string[] args) 4 {5 6//Get the current running program's Directory 7 string filedir = Environment.currentdirectory; 8
C # obtain the current path
// Obtain the path or UNC location of the loaded file that contains the list.Public static string sapplicationpath = assembly. getexecutingassembly (). location;// Result: X: \ XXX. dll (directory where the. dll
// Obtain the path or UNC location of the loaded file that contains the list.Public static string sapplicationpath = assembly. getexecutingassembly (). location;
// Result: X: \ XXX. dll (directory where the. dll file is located +. dll file name)
/
File operations are very basic and important content in the program, while paths, files, directories, and I/O are common topics in file operations, I would like to summarize these common problems and try to provide some solutions for each problem.
Previously, I was very depressed. I couldn't find a way to get the path of the current project (I could find it indirectly, but it was awkward). Today I accidentally saw a blog and reprinted it.
// Obtain the path or UNC location of the
Previously, I was very depressed. I couldn't find a way to get the path of the current project (I could find it indirectly, but it was awkward). Today I accidentally saw a blog and reprinted it.
// Obtain the path or UNC location of the loaded file
The FileUpload control displays a text box control and a browse button, allowing you to select a file on the client and upload it to the Web server. You can enter the complete path of the file on the Local Computer in the control text box.
You can
You can enter the complete path of the file on the local computer (for example,C: MyFilestest. Txt) To specify the file to be uploaded. You can also click the Browse button and then select a file in the select File dialog box.After you select the
Asp tutorial. net c # FAQ path, file, directory, io summaryMain content:1. Path-related operations, such as determining whether the path is valid, path type, specific part of the path, merged path, and system folder path;2. Related general file
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.